package com.portal.system.api;

import com.portal.common.core.constant.SecurityConstants;
import com.portal.common.core.constant.ServiceNameConstants;
import com.portal.common.core.domain.R;
import com.portal.system.api.domain.SysRole;
import com.portal.system.api.factory.RemoteUserFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;

@FeignClient(contextId = "remoteRoleService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteUserFallbackFactory.class)
public interface RemoteRoleService {
    /**
     * 获取指定角色信息
     *
     * @param roleId 角色id
     * @return 结果
     */
    @GetMapping(value = "/role/selectRoleById/{roleId}")
    public R<SysRole> selectRoleById(@PathVariable("roleId") Long roleId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping(value = "/role/selectRoleList")
    R<List<SysRole>> selectRoleList(SysRole role, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
